﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Data;
using System.Windows.Documents;
using System.Windows.Input;
using System.Windows.Media;
using System.Windows.Media.Imaging;
using System.Windows.Navigation;
using System.Windows.Shapes;
using TagPropagator;

namespace TagPropagator.Controls
{
    public class NodeControl : CheckBox
    {
        public static readonly DependencyProperty IDProperty;
        public static readonly DependencyProperty TopProperty;
        public static readonly DependencyProperty LeftProperty;
        public static readonly DependencyProperty NodeProperty;
        public static readonly DependencyProperty XProperty;
        public static readonly DependencyProperty YProperty;

        static NodeControl()
        {
            DefaultStyleKeyProperty.OverrideMetadata(typeof(NodeControl), new FrameworkPropertyMetadata(typeof(NodeControl)));

            IDProperty = DependencyProperty.Register("ID", typeof(int), typeof(NodeControl));
            TopProperty = DependencyProperty.Register("Top", typeof(double), typeof(NodeControl));
            LeftProperty = DependencyProperty.Register("Left", typeof(double), typeof(NodeControl));
            NodeProperty = DependencyProperty.Register("Node", typeof(object), typeof(NodeControl));
            XProperty = DependencyProperty.Register("X", typeof(double), typeof(NodeControl));
            YProperty = DependencyProperty.Register("Y", typeof(double), typeof(NodeControl));
        }

        public int ID
        {
            get { return (int)GetValue(IDProperty); }
            set { SetValue(IDProperty, value); }
        }

        public double Top
        {
            get { return (double)GetValue(TopProperty); }
            set { SetValue(TopProperty, value); }
        }

        public double Left
        {
            get { return (double)GetValue(LeftProperty); }
            set { SetValue(LeftProperty, value); }
        }

        public object Node
        {
            get { return GetValue(NodeProperty); }
            set { SetValue(NodeProperty, value); }
        }

        public double X
        {
            get { return (double)GetValue(XProperty); }
            set { SetValue(XProperty, value); }
        }

        public double Y
        {
            get { return (double)GetValue(YProperty); }
            set { SetValue(YProperty, value); }
        }

        //próba czy przepisanie properties z Node zadziała zadziała

        public static readonly DependencyProperty ImageProperty = DependencyProperty.Register("Image", typeof(string), typeof(NodeControl));
        public String Image
        {
            get { return (String)GetValue(ImageProperty); }
            set { SetValue(ImageProperty, value); }
        }
    }
}
